# coding:utf-8
from marshmallow import fields

from ..extensions import ma
from app.api.utils import EmptyStrValidator


class VersionSchema(ma.Schema):
    """
    create by ld_wu 2017-11-29
    """
    version = fields.Str(
        required=True,
        error_messages={
            'required': '版本号为必填'
        },
        validate=EmptyStrValidator(error='版本号不能为空')
    )

    url = fields.Url(
        required=True,
        error_messages={
            'required': 'App下载地址为必填'
        }
    )

version_schema = VersionSchema()
